// 收/付款对应的单据明细
const {DataTypes, db } = require("../db");
db.define('invoiceReceipt', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,defaultValue:0,comment:''}, 
iid:{type: DataTypes.INTEGER,allowNull:false,comment:'自身关联单据ID'}, 
billType:{type: DataTypes.STRING(30),comment:'源单据类型'}, 
transType:{type: DataTypes.INTEGER,comment:'源单据类型'}, 
transTypeName:{type: DataTypes.STRING(20),comment:'票据类型'}, 
billNo:{type: DataTypes.STRING(30),comment:'票号'}, 
billDate:{type: DataTypes.STRING(10),comment:'票据开票日期'}, 
billId:{type: DataTypes.INTEGER,allowNull:false,comment:'收/付款 对应收或付的单据ID'}, 
srcBillNo:{type: DataTypes.STRING(30),defaultValue:(''),comment:'收付款的源单号'}, 
srcBillType:{type: DataTypes.STRING(30),comment:''}, 
srcTransType:{type: DataTypes.INTEGER,comment:''}, 
srcTransTypeName:{type: DataTypes.STRING(255),comment:''}, 
accountedDate:{type: DataTypes.STRING(10),comment:'票据审核日期'}, 
totalAmount:{type: DataTypes.DECIMAL(20, 2),comment:'票据总金额'}, 
arrears:{type: DataTypes.DECIMAL(20, 2),comment:'票据审核时候的欠款'}, 
hxAmount:{type: DataTypes.DECIMAL(20, 2),comment:'此单前已核销金额'}, 
leftAmount:{type: DataTypes.DECIMAL(20, 2),comment:'未收/未付'}, 
nowCheck:{type: DataTypes.DECIMAL(18, 2),defaultValue:0,comment:'本次收款'}, 
yhAmount:{type: DataTypes.DECIMAL(18, 2),defaultValue:0,comment:'收款优惠'}, 
accountInfoId:{type: DataTypes.INTEGER,comment:'收款时 应付款抵扣票据 的明细ID'}, 
remark:{type: DataTypes.STRING(255),comment:'备注'}, 
oldId:{type: DataTypes.INTEGER,comment:''}, 
del:{type: DataTypes.INTEGER,defaultValue:0,comment:'是否删除 0|1'}, 
yeAmount:{type: DataTypes.DECIMAL(18, 2),defaultValue:0,comment:'余额'}, 
billState:{type: DataTypes.STRING(20),comment:'状态'}, 
listType:{type: DataTypes.STRING(20),comment:'hxList|billList 核销单 列表类型'}, 

}, {
    tableName: 'invoice_receipt',
    timestamps: false,
    comment: '收/付款对应的单据明细',
    
});